import java.util.Arrays;

public class Solution1877 {
    public int minPairSum(int[] nums) {
        Arrays.sort(nums);
        int max=0;
        int n=nums.length/2;
        for (int i=0;i<n;i++){
            max=Math.max(max,nums[i]+nums[n*2-i-1]);
        }
        return max;
    }

    public static void main(String[] args) {
        System.out.println(new Solution1877().minPairSum(new int[]{3,5,2,3}));
    }
}
